import service from '../utils/request'

// 获取读者列表
export const getReaderList = (params) => {
    return service({
        url: '/reader/list',
        method: 'get',
        params
    })
}

// 添加读者
export const addReader = (data) => {
    return service({
        url: '/reader/add',
        method: 'post',
        data
    })
}

// 更新读者
export const updateReader = (data) => {
    return service({
        url: '/reader/update',
        method: 'put',
        data
    })
}

// 获取借阅记录
export const getBorrowRecords = (readerId) => {
    return service({
        url: `/reader/borrowRecords/${readerId}`,
        method: 'get'
    })
}

// 更新读者状态
export const updateReaderStatus = (readerId, status) => {
    return service({
        url: '/reader/updateStatus',
        method: 'put',
        data: { readerId, status }
    })
}
